@layout("/common/_curd/_container.html"){

<script type="text/javascript">
	var ctx = "${basePath}";
	var grid_selector = "#grid-table";
	var pager_selector = "#grid-pager";
	
	$(function(){
		initGrid();
		initMenuBtn("btns", "${code}");
	});
	
	function initGrid(){
		var grid_url = ctx + "/${code}/list";
		var _colnames = ["ID",
						"电站编号", 
						"电站名称", 
						"电站类型", 
						"省", 
						"市", 
						"县", 
						"具体位置", 
						"经度", 
						"纬度", 
						"创建人", 
						"创建时间", 
						"电站状态"];
		var _colmodel = [{name:"id", index:"id", width:100},
						{name:"number", index:"number", width:100},
						{name:"name", index:"name", width:100},
						{name:"classify", index:"classify", width:100},
						{name:"province", index:"province", width:100},
						{name:"city", index:"city", width:100},
						{name:"county", index:"county", width:100},
						{name:"address", index:"address", width:150},
						{name:"longitude", index:"longitude", width:50},
						{name:"latitude", index:"latitude", width:50},
						{name:"createAc", index:"createAc", width:100},
						{name:"createAt", index:"createAt", width:150},
						{name:"status", index:"status", width:100, editoptions:{value:"1:在用;2:过期;"},
							formatter:function(cellvalue, options, rowObject){
								if(rowObject.status == 1){
									return "<div style='color:green;'>在用</div>";
								}else if(rowObject.status == 2){
									return "<div style='color:red;'>过期</div>";
								}else{
									return "状态错误！"
								}
							}
							}];
		
		jQuery(grid_selector).jqGrid({
			url : grid_url,
		    shrinkToFit : true,
			colNames : _colnames,
			colModel : _colmodel, 
			jsonReader : {id :"id"},
			pager : pager_selector,
			postData : {sort : "id", order : "desc"}
		});
	}
</script>


	<!-- 配置 grid -->
	<div class="row">
		<div class="col-xs-12 tb-grid">
			<!-- 配置 查询 -->
			@ var _col=[
			@		{name:"ID", index:"id", type:"text"},
			@		{name:"电站编号", index:"number", type:"text"},
			@		{name:"电站名称", index:"name", type:"text"},
			@		{name:"电站类型", index:"classify", type:"text"},
			@		{name:"省", index:"province", type:"text"},
			@		{name:"市", index:"city", type:"text"},
			@		{name:"县", index:"county", type:"text"},
			@		{name:"具体位置", index:"address", type:"text"},
			@		{name:"经度", index:"longitude", type:"text"},
			@		{name:"纬度", index:"latitude", type:"text"},
			@		{name:"创建人", index:"createAc", type:"text"},
			@		{name:"创建时间", index:"createAt", type:"text"},
			@		{name:"电站状态 1 在用 2过期", index:"status", type:"text"}							
			@];
			@ include("/common/_function/_search.html",{"col":_col}){}
			<!-- 按钮 -->
			<div class="welljq well-sm" id="btns"></div>
			<!-- grid -->
			<table id="grid-table"></table>
			<!-- 分页-->
			<div id="grid-pager"></div>
		</div>
	</div>
	
	<!-- 引入所需的js -->
	@include("/common/_listscript.html"){}
	
@}	